package com.aiyige.model.moment.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by zhuyakun on 2018/1/22.
 */

public class Content implements Parcelable{
    public static final int TYPE_TEXT = 1;
    public static final int TYPE_PHOTO = 2;
    public static final int TYPE_VIDEO = 3;
    public static final int FONT_STYLE_BIG_TITLE = 1;
    public static final int FONT_STYLE_SMALL_TITLE = 2;
    public static final int FONT_STYLE_MAIN_BODY = 3;

    String title;
    String text;
    Integer fontStyle;
    String cover;
    String url;
    Integer type;
    Integer sortNum;
    Boolean defaultMedia;
    String persistentId;

    public String getPersistentId() {
        return persistentId;
    }

    public void setPersistentId(String persistentId) {
        this.persistentId = persistentId;
    }

    public Boolean getDefaultMedia() {
        return defaultMedia;
    }

    public void setDefaultMedia(Boolean defaultMedia) {
        this.defaultMedia = defaultMedia;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public Integer getFontStyle() {
        return fontStyle;
    }

    public void setFontStyle(Integer fontStyle) {
        this.fontStyle = fontStyle;
    }

    public String getCover() {
        return cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getSortNum() {
        return sortNum;
    }

    public void setSortNum(Integer sortNum) {
        this.sortNum = sortNum;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.title);
        dest.writeString(this.text);
        dest.writeValue(this.fontStyle);
        dest.writeString(this.cover);
        dest.writeString(this.url);
        dest.writeValue(this.type);
        dest.writeValue(this.sortNum);
        dest.writeValue(this.defaultMedia);
        dest.writeString(this.persistentId);
    }

    public Content() {
    }

    protected Content(Parcel in) {
        this.title = in.readString();
        this.text = in.readString();
        this.fontStyle = (Integer) in.readValue(Integer.class.getClassLoader());
        this.cover = in.readString();
        this.url = in.readString();
        this.type = (Integer) in.readValue(Integer.class.getClassLoader());
        this.sortNum = (Integer) in.readValue(Integer.class.getClassLoader());
        this.defaultMedia = (Boolean) in.readValue(Boolean.class.getClassLoader());
        this.persistentId = in.readString();
    }

    public static final Creator<Content> CREATOR = new Creator<Content>() {
        @Override
        public Content createFromParcel(Parcel source) {
            return new Content(source);
        }

        @Override
        public Content[] newArray(int size) {
            return new Content[size];
        }
    };
}
